/**
 * Copyright (c) 2012 Ben Murphy (Smurph)
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.smurph.expandablelist.provider;

import java.util.Arrays;

import android.net.Uri;

import com.smurph.expandablelist.provider.TblName.Names;

public class TblABC {

	public static final String[] abcs = { "A", "B", "C", "D", "E", "F", "G",
			"H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
			"U", "V", "W", "X", "Y", "Z" };
	static {
		Arrays.sort(abcs);
	}
	
	public TblABC() {
	}
	
	public static final String mCreate_Table = "CREATE TABLE " + ABCs.TBL_ABC
			+ " ( " + ABCs._ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ ABCs.LETTER + "  TEXT, "
			+ Names.ACTIVE + " BOOLEAN DEFAULT(1));";
	
	public static final class ABCs {
		public ABCs() {
		}

		public static final String TBL_ABC = "TblABC";
		public static final String _ID = "_id";
		public static final String LETTER = "Letter";
		public static final String ACTIVE = "Active";

		public static final Uri CONTENT_URI = Uri.parse("content://"
				+ MyContentProvider.AUTHORITY + "/" + TBL_ABC);
		
		public static final String SORT_ORDER_DESC = LETTER + " DESC";
		public static final String SORT_ORDER_ASC = LETTER + " ASC";

		public static final String[] DEFAULT_PROJECTION = new String[] { _ID,
				LETTER };
		
		public static final String ABC_NAMES_JOIN = " " + TBL_ABC
				+ " LEFT JOIN " + Names.TBL_NAMES + " ON " + Names.TBL_NAMES
				+ "." + Names.ABC_ID + " = " + TBL_ABC + "." + _ID + " ";
	}
}
